package com.zxn.xiaoran.view.base;


import com.zxn.presenter.presenter.BasePresenter;
import com.zxn.presenter.view.BaseFragment;

/**
 * Created by zxn on 2019/5/21.
 */
public abstract class XMFragment<P extends BasePresenter> extends BaseFragment<P> {

    public XMFragment() {
    }

    @Override
    protected void onInvisible() {

    }


    @Override
    protected void initData() {

    }

    @Override
    public void showToast(int msg) {

    }

    @Override
    public void showToast(String msg) {
        if (getActivity() instanceof XMActivity) {
            XMActivity xmActivity = (XMActivity) getActivity();
            xmActivity.showToast(msg);
        }
    }

    @Override
    public void showLoading(boolean cancelable) {

    }

    @Override
    public void showLoading(String msg, boolean cancelable) {

    }

    @Override
    public void showLoading(String msg) {

    }

    @Override
    public void showLoading(int msgResId) {

    }

    @Override
    public void closeLoading() {
        if (getActivity() instanceof XMActivity) {
            XMActivity xmActivity = (XMActivity) getActivity();
            xmActivity.closeLoading();
        }
    }

//    @Override
//    public void initImmersionBar() {
//        ImmersionBar.with(this).keyboardEnable(true).init();
//    }
//
//    /**
//     * 默认不启用.
//     *
//     * @return
//     */
//    @Override
//    public boolean immersionBarEnabled() {
//        return false;
//    }
}
